import Vue from 'vue'
import App from './App'
import router from './router'
import store from "./store/index.js"
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import axios from 'axios'
import VueAxios from 'vue-axios'
import "./scss/main.scss"



Vue.use(VueAxios, axios)
Vue.use(ElementUI)
Vue.config.productionTip = true
//定义请求地址
Vue.prototype.url = "";
Vue.prototype.url = "http://localhost/tiandian_man";
//Vue.prototype.url = "http://localhost";
//Vue.prototype.url = "/tiandian_man";
//全局公共组件
import sCascader from "./components/cascader/cascader.vue"
Vue.component("s-cascader", sCascader);

/*router.beforeEach((to, from, next) => {
	console.log(router.matcher)
});*/





/* eslint-disable no-new */
new Vue({
  el: '#app',
  store,
  router,
  template: '<App/>',
  components: { App }
})

//全局时间过滤器
Vue.filter("formatTime", function(t) {
				var date = new Date(t);
				var year = date.getUTCFullYear();
				var month = date.getMonth() + 1;
				var day = date.getDate();
				var hour = date.getHours();
				var minus = date.getMinutes()
				if(month < 10) {
					month = "0" + month;
				}
				if(day < 10) {
					day = "0" + day;
				}
				if(hour < 10) {
					hour = "0" + hour;
				}
				if(minus < 10) {
					minus = "0" + minus;
				}
				return year + "-" + month + "-" + day + " " + hour + ":" + minus;
});